﻿using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using suanpan.API.Components.Behaviors.ErrorHandling;

namespace suanpan.API.Components.Behaviors.EndpointBehaviors
{
    public class RestWebHttpBehavior : WebHttpBehavior
    {
        protected override void AddServerErrorHandlers(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
        {
            endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.Add(new RestErrorBehavior());
        }

    }
}
